import Layout from '@/layout'
import SettingEnv from '@/setting.env'

const pre = 'product_'

export default {
  path: `${SettingEnv.customRouter}/product`,
  component: Layout,
  name: 'product',
  redirect: `${SettingEnv.customRouter}/product/product_list`,
  meta: {
    title: '商品',
    icon: 'el-icon-s-goods'
  },
  children: [
    {
      path: 'product_list',
      name: `${pre}productList`,
      meta: {
        title: '商品管理',
        noCache: false
      },
      component: () => import('@/views/product/productList/index')
    },
    {
      path: 'product_classify',
      name: `${pre}productClassify`,
      meta: {
        title: '商品分类',
        noCache: false
      },
      component: () => import('@/views/product/productClassify')
    },
    {
      path: 'product_attr',
      name: `${pre}product_attr`,
      meta: {
        title: '商品规格'
      },
      component: () => import('@/views/product/productAttr')
    },
    {
      path: `product_reply`,
      name: `${pre}product_reply`,
      meta: {
        title: '商品评论',
        activeMenu: `${ SettingEnv.customRouter }/product/product_reply`
      },
      component: () => import('@/views/product/productReply')
    },
    {
      path: 'add_product/:id?/:isDisabled?',
      hidden: true,
      name: `${pre}productAdd`,
      meta: {
        title: '商品添加',
        activeMenu: `${ SettingEnv.customRouter }/product/product_list`
      },
      component: () => import('@/views/product/productAdd')
    }
  ]
}
